1. Field of the Invention
This invention relates to data processing systems. More particularly, this invention relates to the insertion of bits within a data word under program control.
2. Description of the Prior Art
It is known within data processing systems to pack together a plurality of fields of bits within a single data word. As an example, within a 16 bit data word it may be desired to pack three colour component values respectively representing red, green and blue values, two of which are of 5 bits in length and one of which is 6 bits in length. It is often the case that these different component values will be separately processed and their magnitudes separately calculated. After such calculations the separate components require assembling together within a single data word such that they may be stored in a more compact form and more readily manipulated on a pixel-by-pixel basis.
In order to achieve such data packing, one possible solution is to provide program instructions which specify both a length of a bit field within a source register which is to be inserted into a destination register and the position within the destination register at which that bit field is to be inserted. Such an instruction will typically have to specify the source register, the destination register, the bit field length and the bit field insertion position. Having to specify four separate parameters within a single instruction in this way places a disadvantageously high demand upon the instruction bit space available within the instruction and makes such instructions disadvantageous in terms of the instruction bit space they consume.